
#ifndef SX_MSM_PREVIEW_STATE_H
#define SX_MSM_PREVIEW_STATE_H

#include <sxMassSpringMesh.h>
#include <sxStoredPhysicalRepresentation.h>
#include <sxStoredMesh_Archetype.h>
#include <sxMesh.h>

/* Sx library types. */
using Sx::Simulation::Objects::MassSpringMesh;
using Sx::Physics::StoredPhysicalRepresentation;
using Sx::Physics::Archetypes::Objects::StoredMesh_Archetype;
using Sx::Graphics::Objects::Mesh;

namespace Sx {
namespace Simulation {
namespace Recording {

class MSM_PreviewState {
public:
	MSM_PreviewState();
	virtual ~MSM_PreviewState();

	/*
	 * Stores the data from the provided Mass-Spring mesh into the internal
	 * stored physical representation.
	 */
	bool save(const std::shared_ptr<MassSpringMesh>& massSpringMesh);

	/*
	 * Copy the data from the internal surface and stored physical
	 * representation into the provided stored mesh archetype. This is simple
	 * because the stored mesh archetype is composed of a mesh (which contains
	 * a mapped surface) and a stored physical representation.
	 */
	bool load(StoredMesh_Archetype& storedMesh);

protected:
	Mesh mesh;
	StoredPhysicalRepresentation meshPreviewStorage;
};

}

}

}

#endif
